<?php
require_once(dirname(__FILE__) . '/PortalUtil.class.php');

class NodeEmp extends PortalUtil {
	public $tbl = Constant::tbl_wifi_node_emp;

	function __construct() {
		$request['update'] = '$Date: 2009/02/16 07:36:07 $';
		$request['revision'] = '$Revision: 1.1 $';

		parent::__construct($request);
	}
	
	function _valid($request, $user) {
		
		$gw_id = $this->_dog_id($request);
		$emp = $user['emp'];
		
		$db = newdb($this->dsn_r);
		$fmt = "SELECT * FROM %s WHERE node = '%s' AND emp = '%s'";
		$sql = sprintf($fmt, $this->tbl, $gw_id, $emp);
		debug($sql);
		$result = $db->query($sql);
		if ($row = $db->fetch_array($result)) {
			if ($row['status'] == '1') {
				return true;
			}
		}
		
		return false;
	}
}
?>
